Ranging apparatus

ABSTRACT

This invention relates to a ranging apparatus capable of ranging simultaneously to a three dimensional scene. An illumination means ( 22 ) illuminates a scene with a two dimensional array of spots ( 12 ). A detector ( 6 ) is located near to the illumination means ( 22 ) and arranged to look toward the scene. A processor ( 7 ) responds to the output from the detector ( 6 ) and, from the location of a spot in the image of the scene, determines the range to that spot. A variety of techniques are used to resolve ambiguity in determining which projected spot is being considered.

This invention relates to a range finding apparatus, especially to animaging range finding apparatus.

Imaging range finding systems often illuminate a scene and image thelight reflected from the scene to determine range information.

One known system, a so called triangulation system, uses a sourcearranged to illuminate a scene with a beam of light such that a spotappears in the scene. A detector is oriented in a predetermined fashionwith respect to the source such that the position of the spot of lightin the scene reveals range information. The beam of light may be scannedin both azimuth and elevation across the scene to generate rangeinformation from across the whole scene. In some systems the beam oflight may be a linear beam such that one dimensional range informationis gathered simultaneously and the linear beam scanned in aperpendicular direction to gain range information in the otherdimension.

Systems such as this require scanning which adds to the cost andcomplexity and also means that accurate ranging is not possible withfast changing scenes. Further the illumination in known triangulationsystems often requires laser systems. Use of laser systems may havesafety implications and can require complicated and relatively expensivescanning mechanisms. Lasers are also relatively high power sources.

U.S. Pat. No. 6,154,279 discloses a method and apparatus for determiningthe shapes of countersunk holes. At least one laser directs laser lighttowards the surface having the hole so as to create a light spot and thelateral displacement of the spot as compared to a reference image f aflat surface is used to give depth information. In one embodiment thelaser(s) may project a plurality of spots so that analysis of many spotscan be performed in one image. However the method as described in U.S.Pat. No. 6,154,279 is only appropriate for looking at continuoussurfaces in a known limited depth of field and requires a model of theobserved surface to work correctly. It is not therefore applicable toproviding range information from a scene consisting of discrete objectsover a large depth of field.

U.S. Pat. No. 4,294,544 describes a system for obtaining threedimensional topographic data from a scene. The scene is illuminated witha plurality of laser beams which are switched on and off in apredetermined sequence so that each spot detected in the scene can beidentified with one of the projected beams. An imager is arranged toview the scene illuminated with each of the different pattern of spotsand, once a spot has been identified, determine the range to that spot.The method involves several projection stages however and uses lasersand relatively complex shutter arrangements to project the differentpatterns. The projection stages also take time, so similar to scannedsystems, the apparatus described is not suitable for use for relativelyfast changing scenes.

U.S. Pat. No. 4,867,570 discloses a method and apparatus for obtainingthree dimensional information about an object by projecting a pluralityof pattern beams onto the object. A light source is arranged behind amask having a plurality of windows. A lens projects an image of thelight source as seen through the mask onto the object to be imaged andanother lens of the same power and arranged in the same plane with aparallel optical axis to the first lens images the scene onto a CCDarray. The position of the spots in the scene gives the range to thatspot although the method by which the range is calculated is not clear.The depth of field of the projection system is somewhat limited howeverbecause of the use of a lens imaging the illuminated mask and also theprojection means will not have a wide angle of projection. Thereforeagain the invention described will only be applicable to imagingrestricted fields of view in a narrow operating range.

An alternative ranging system is described in U.S. Pat. No. 6,377,353.Here a light source is arranged in front of a patterned slide which hasan array of apertures therein. Light from the source only passes throughthe apertures so as to project an array of spots onto the scene. Therange information in this apparatus is determined by analysing the sizeand shape of the spots formed. This system requires the size of thespots and orientation thereof to be determinable however which requiresreasonable differences in spot size. The system necessarily thereforehas a limited depth of view and is only really usable for ranging tocontinuous surfaces.

It is therefore an object of the present invention to provide a rangingapparatus that mitigates at least some of the above mentioneddisadvantages and is useable over a large depth of field and for sceneshaving discrete objects located therein.

Therefore according to the present invention there is provided a rangingapparatus comprising an illumination means for illuminating a scene witha two dimensional array of light spots, a detector for detecting thelocation of spots in the scene and a processor adapted to determine,from the detected location of a spot in the scene, the range to thatspot.

The illumination means illuminates the scene with an array of spots. Thedetector then looks at the scene and the processor determines thelocation of spots in the detected scene. The apparent location of anyspot in the array will change with range due to parallax. As therelationship of the detector to the illumination means is known, thelocation in the scene of any known spot in the array can yield the rangeto that point.

Of course, to be able to work out the range to a spot, it is necessaryto know which spot in the array is being considered. In the prior artsingle spot systems, there is only one spot in the scene and so there isno difficulty. Even when using a linear beam the beam is projected so asto be parallel to one direction, say the y-direction. For each value inthe y-direction then the actual x-position in the scene can then be usedto determine the range.

Were a two dimensional array of spots to be used however the spots wouldbe distributed in both the x and y directions. The skilled person wouldtherefore not be inclined to use a two dimensional array of spots asthey would have thought that this would have meant that the rangingsystem would either be unable to determine which spot was which andhence could not perform ranging or would produce a result that couldsuffer from errors if the wrong spot had been considered. The presentinvention however does allow use of a two dimensional array of spots forsimultaneous ranging of a two-dimensional scene and uses varioustechniques to avoid ambiguity over spot determination.

U.S. Pat. No. 4,294,544 does teach use of an array of spots but teachesthat the spots are switched on and off in a predetermined fashion sothat each spot can be uniquely identified by determining which frames itappears in. This requires a relatively complex illumination systemhowever and also requires several frames of the scene to be taken addingto the time taken to gain range information. Where the projected arrayconsists of N columns of spots the method of U.S. Pat. No. 4,294,544requires the number of images I to be acquired to be I=1+log₂N.

U.S. Pat. No. 6,154,279 also teaches projection of an array of spots forranging purposes but only in very controlled circumstances, over a veryrestricted depth of field where ambiguity is unlikely to be a problemand only for known continuous surfaces which can be modelled by theranging apparatus. U.S. Pat. No. 4,867,570 further teaches projection ofan array of spots for range determination but gives no indication of howthat range information is determined nor how ambiguities in the scenemay be resolved.

As used herein the term array of spots is taken to mean any array whichis projected onto the scene and which has distinct areas of intensity.Generally a spot is any distinct area of high intensity radiation andmay, as will be described later, be adapted to have a particular shape.The areas of high intensity could be linked however provided that thedistinct spot can be identified. For instance the illumination means maybe adapted to project an array of intersecting lines onto the scene. Theintersection of the lines is a distinct point which can be identifiedand is taken to be a spot for the purposes of this specification.

Conveniently the illumination means and detector are arranged such thateach spot in the projected array appears to move in the detected scene,from one range to another, along an axis and the axis of apparent motionof each adjacent spot in the projected array is different. As will beexplained later each spot in the array will appear at a different pointin scene depending upon the range to the target. If one were to imaginea flat target slowly moving away from the detector each spot wouldappear to move across the scene. This movement would, in a well adjustedsystem used in certain applications, be in a direction parallel to theaxis joining the detector and illumination means, assuming no mirrorsetc. were placed in the optical path of the detector or illuminationmeans. Each spot would however keep the same location in the scene inthe direction perpendicular to this axis. For a different arrangement ofillumination means and detector the movement would appear to be alonggenerally converging lines.

Each projected spot could therefore be said to have a locuscorresponding to possible positions in the scene at different rangeswithin the operating range of the system, i.e. the locus of apparentmovement would be that part of the axis of apparent motion at which aspot could appear, as defined by the set-up of the apparatus. The actualposition of the spot in the detected scene yields the range information.Where the apparent direction of movement of a spot at various rangeshappens to be the same as for another spot then the loci correspondingto the different spots in the projected array may overlap. In which casethe processor would not be able to determine which spot in the projectedarray is being considered. Were the loci of spots which are adjacent inthe projected array to overlap, measurement of the location in the sceneof a particular spot could correspond to any of a number of differentranges with only small distances between the possible ranges. Forexample, imagine the array of spots was a two dimensional array of spotsin an x-y square grid formation and the detector and illumination meanswere spaced apart along the x-axis only. Using Cartesian co-ordinates toidentify the spots in the projected array with (0,0) being the centrespot and (1,0) being one spot along the x-axis, the location in thescene of the spot at position (0,0) in the projected array at one rangemight be the same as the position of projected spot (1, 0) at anotherslightly different range or projected even spot (2,0) at a slightlydifferent range again. The ambiguity in the scene would therefore makerange determination difficult.

Were however the detector and illumination means arranged such that theaxis between them was not parallel to either the x-axis or the y-axis ofthe projected array then adjacent spots would not overlap. Ideally thelocus of each spot in the projected array would not overlap with thelocus of any other spot but in practice with relatively large spots andlarge arrays this may not be possible. However if the arrangement wassuch so that the loci of each spot only overlapped with that of a spotrelatively far removed in the array then although ambiguity would stillbe present the amount of ambiguity would be reduced. Further thedifference in range between the possible solutions would be quite large.For example the range determined were a particular projected spot, (0,4)say, to be detected at one position in the scene could be significantlydifferent from that determined if a spot removed in the array (5,0)appeared at the same position in the scene. In some applications theoperating range may be such that the loci corresponding to the variouspossible locations in the scene of the spots within the operating windowwould not overlap and there would be no ambiguity. Even where the rangeof operation would allow the loci of spots to overlap the significantdifference in range could allow a coarse estimation of range to beperformed to allow unique determination of which spot was which with thelocation of each spot in the scene then being used to give fine rangeinformation.

One convenient way of determining coarse range information involves theillumination means and detector being adapted such that a projectedarray of spots would appear sharply focussed at a first distance andunfocussed at a second distance, the first and second distances beingwithin the operating range of the apparatus. The processor is adapted todetermine whether a spot is focussed or not so as to determine coarserange information. For example if a detected spot could correspond toprojected spot (0,4) hitting a target at close range or projected spot(5,0) hitting a target at long range the processor could look at theimage of the spot to determine whether the spot is focussed or not. Ifthe illumination means and detector were together adapted such that thespots were focussed at long range the determination that the spot inquestion was focussed would mean that the detected spot would have to beprojected spot (5,0) hitting a target at long range. Had an unfocussedspot been detected this would have corresponded to spot (0,4) reflectedfrom a target at close range. Preferably in order to ease identificationof whether a spot is focussed or not the illumination means is adaptedto project an array of spots which are non-circular in shape whenfocussed, for instance square. An in focus spot would then be squarewhereas an unfocussed spot would be circular. Of course other coarseranging methods could be used—the size of a spot could be used as anindication of coarse range.

The present invention therefore allows the determination of range in ascene using a single captured frame of a scene. This avoids the need forcomplicated coding systems such as described in U.S. Pat. No. 4,294,544allowing for very fast ranging. Further the processor uses the positionof a spot in the scene to determine the possible range and where thereis a possible ambiguity in range can look at secondary characteristicssuch as the shape of the spot to resolve any ambiguity. The processormay thus be adapted to resolve any residual ambiguity present in thescene. Of course the position of other spots in the scene may also betaken into account in assessing whether there is any ambiguity. In theexample above, if an observed spot could correspond to projected spot(5,0) or (0,4) but another spot observed in the scene could only be dueto projected spot (5,0) or no other spot in the scene could correspondto projected spot (0,4) then the ambiguity is resolved (although thisassumes that the detector can see all spots projected to the scene).

The present invention therefore provides a ranging system having a largedepth of field and having means for resolving any ambiguity inidentification of observed spots. The invention may be used on sceneshaving lots of discrete items at various ranges and provides fastranging so can be used on evolving scenes. For some applications theranging apparatus may be able to resolve range to objects in a scenewithin an operating window of 150 millimetres to 2.5 metres giving alarge field of view. Other applications may be used with even largeroperating windows or a greater maximum range or shorter minimum range.The preferred illumination means of the present invention as will bedescribed later can usefully produce a depth of field from 150 mm toinfinity.

As an additional or alternative method of resolving possible ambiguitythe illumination means could be adapted to periodically alter the twodimensional array of projected spots, i.e. certain spots could be turnedon or off at different times. The apparatus could be adapted toilluminate the scene cyclically with different arrays of spots. Ineffect one frame could be divided into a series of sub-frames with asub-array being projected in each sub-frame. Each sub-array would beadapted so as to present little or no range ambiguity in that sub-frame.Over the whole frame the whole scene could be imaged in detail butwithout ambiguity. This approach has the disadvantage though thatimaging may take several sub-frames. However unlike the approach adoptedin U.S. Pat. No. 4,294,544 where illumination with various sub-frames isneeded to perform spot identification the present invention performsranging on the data acquired each sub-frame. The use of more than onesub-frame increases, over time, the number of range points in the imageso increases the image resolution with respect to range. The presentinvention may therefore operate with fewer sub-frames than the prior artand can still be used to give good resolution to relatively fastchanging scenes.

An alternative approach could be to illuminate the scene with the wholearray of spots and identify any areas of ambiguity. If a particulardetected spot could correspond to more than one projected spot atdifferent ranges, one or more of the possible projected spots could thenbe deactivated so as to resolve the ambiguity. This approach may requiremore processing but could allow quicker ranging and would require aminimum of additional sub-frames to be acquired to perform ranging, i.e.less than the I=1+log₂N sub-frames described in U.S. Pat. No. 4,294,544.Depending on the illumination means and the ease of switching individualspots off it may generally be sufficient to take one additionalsub-frame with a sub-set of spots illuminated to provide completeranging information.

Additionally or alternatively the illumination means may be adapted soas to produce an array of spots wherein at least some projected spotshave a different characteristic to their adjacent spots. The differentcharacteristic could be colour or shape or both. Having a differentcolour or shape of spot again reduces ambiguity in detected spots.Although the loci of different spots may overlap, and there may be someambiguity purely based on spot location in the scene, if the projectedspots giving rise to those loci are different in colour and/or shape theprocessor would be able to determine which spot was which and therewould be no ambiguity. The detector and illumination means are thereforepreferably arranged such that if the locus of one projected spot doesoverlap with the locus of one or more other projected spots at least thenearest projected spots having a locus in common have differentcharacteristics.

As mentioned above the spots may comprise intersections betweencontinuous lines. The detector can then locate the spots, or areas wherethe lines intersect, as described above. Preferably the illuminationmeans projects two sets of regularly spaced lines, the two sets of linesbeing substantially orthogonal.

Using intersecting lines in this manner allows the detector to locatethe position of the intersection points in the same manner as describedabove. Once the intersection points have been found and identified theconnecting lines can also be used for range measurements. In effect theintersection points are used to identify the various lines in theprojected array and once so identified all of the points on that linecan be used to give range information. Thus the resolution of the rangefinding apparatus can be improved over that using only separated spots.

The detector is conveniently a two dimensional CCD array, i.e. a CCDcamera. A CCD camera is a relatively cheap and reliable component andhas good resolution for spot determination. Other suitable detectorswould be apparent to the skilled person however and would include CMOScameras.

Conveniently the illumination means is adapted such that the twodimensional array of spots are infrared spots. Using infrared radiationmeans that the spots do not affect the scene in the visible range. Thedetector may be adapted to capture a visible image of the scene as wellas the location of the infrared spots in the scene.

The length of the baseline between the detector and the illuminationmeans determines the accuracy of the system. The term baseline refers tothe separation of the line of sight of the detector and the line ofsight of the illumination means as will be understood by one skilled inthe art. As the skilled person will understand the degree of apparentmovement of any particular spot in the scene between two differentranges will go up as the separation or baseline between the detector andthe illumination means is increased. An increased apparent movement inthe scene between different ranges obviously means that the differencein range can be determined more accurately. However equally an increasedbaseline also means that the operating range in which there is noambiguity is also reduced.

The baseline between the detector and the illumination means istherefore chosen according to the particular application. For a rangingapparatus intended to work over an operating distance of say 0.5 m to2.0 m, the baseline of the detector and the illumination means istypically approximately 60 mm.

It should be noted that whilst the baseline of the apparatus will oftenbe the actual physical separation between the detector and theillumination means this will not necessarily always be the case. Someembodiments may have mirrors, beam splitters etc in the optical path ofone or both of the illumination means and the scene. In which case theactual physical separation could be large but by use of appropriateoptical components the apparent separation or baseline, as would beunderstood by one skilled in the art, would still be small. For instancethe illumination means could illuminate the scene directly but a mirrorplaced close to the illumination means could direct received radiationto the detector. In which case the actual physical separation could belarge but the apparent separation, the baseline, would be determined bythe location of the mirror and the detector, i.e. the position thedetector would be if there were no mirror and it received the sameradiation. The skilled person would understand that the term baselineshould be taken as referring to the apparent separation between thedetector and the illumination means.

The detector means may be adapted to image the scene from more than onedirection. The detector could be either moveable from one location toanother location so as to image the scene from a different viewpoint orscanning optics could be placed in the optical path to the detector soas to periodically redirect the look direction. Both of these approachesrequire moving parts however and mean that the scene must be imaged oversub-frames. As an alternative the detector may comprise two detectorarrays each detector array arranged so as to image the scene from adifferent direction. In effect two detectors (two cameras) may be usedeach imaging the scene from a different direction, thus increasing theamount and/or quality of range information.

Imaging the scene from more than one direction can have severaladvantages. Obviously objects in the foreground of the scene may obscureobjects in the background of the scene from certain viewpoints. Changingthe viewpoint of the detector can ensure that range information to thewhole scene is obtained. Further the difference between the two imagescan be used to provide range information about the scene. Objects in theforeground will appear to be displaced between the two images than thosein the background. This could be used to give additional rangeinformation. Also, as mentioned, in certain viewpoints one object in theforeground may obscure an object in the background—this can be used togive relative range information. The relative movement of objects in thescene may also give range information. For instance objects in theforeground may appear to move one way in the scene moving from oneviewpoint to the other whereas objects in the background may appear tomove the other way. The processor therefore preferably applies imageprocessing algorithms to the scenes from each viewpoint to determinerange information therefrom. The type of image processing algorithmsrequired would be understood by one skilled in the art. The rangeinformation revealed in this way may be used to remove any ambiguityover which spot is which in the scene to allow fine ranging. The presentinvention may therefore use processing techniques looking at thedifference in the two images to determine information about the sceneusing known stereo imaging techniques to augment the range informationcollected by analysing the positions of the projected spots.

If more than one viewpoint is used the viewpoints could be adapted tohave different baselines. As mentioned the baseline between the detectorand the illumination means has an effect on the range and the degree ofambiguity of the apparatus. One viewpoint could therefore be used with alow baseline so as to give a relatively low accuracy but unambiguousrange to the scene over the distances required. This coarse rangeinformation could then be used to remove ambiguities from a scene viewedfrom a viewpoint with a larger baseline and hence greater accuracy.

Additionally or alternatively the baselines between the two viewpointscould be chosen such that if a spot detected in the scene from oneviewpoint could correspond to a first set of possible ranges the samespot detected in another viewpoint could only correspond to one rangewithin that first set. In other words imagine that a spot is detected inthe scene viewed from the first viewpoint and could correspond to afirst spot (1,0) at a first range R₁, a second spot (2,0) at a secondrange R₂, a third spot (3,0) at a third range R₃ and so on. The samespot could also give a possible set of ranges when viewed from thesecond viewpoint, i.e. it could be spot (1,0) at range r₁, spot (2,0) atrange r₂, and so on. With appropriate set up of the two viewpoints andthe illumination means when the two sets of ranges are compared it maybe that there is only one possible range common to both sets and thistherefore must be the actual range.

Where more than two viewpoints are used the baselines of at least two ofthe viewpoints may lie along different axes. For instance one viewpointcould be spaced horizontally relative to the illumination means andanother viewpoint spaced vertically relative to the illumination means.The two viewpoints can collectively image the scene from differentangles and so may reduce the problem of parts of the foreground of thescene obscuring parts of the background. The two viewpoints can alsopermit unambiguous determination of any spot as mentioned above butspacing the viewpoints on different axes can aid subsequent imageprocessing of the image. Detection of edges for instance may be aided bydifferent viewpoints as detection of a horizontal edge in a scene can behelped by ensuring the two viewpoints are separated vertically.

In a preferred embodiment the system may comprise at least threedetectors arranged such that two detectors have viewpoints separatedalong a first axis and at least a third detector is located with aviewpoint not on the first axis. In other words the viewpoints of two ofthe detectors are separated in the x-direction and the viewpoint of athird camera is spaced from the first two detectors. Conveniently thesystem may comprise three detectors arranged in a substantially rightangled triangle arrangement. The illumination means may convenientlyform a rectangular or square arrangement with the three detectors. Suchan arrangement gives a good degree of coverage of the scene, allowingunambiguous determination of projected spots by correlating thedifferent images and guarantees two image pairs separated alongorthogonl axes. Stereo imaging techniques could be used on the two setsof image pairs to allow all edges in the image to be analysed.

The apparatus may further comprise a plurality of illumination meansarranged to illuminate the scene from different directions. The systemmay be adapted to periodically change the illumination means used toilluminate the scene so that only one illumination means is used at anytime or the two or more illumination means may be used simultaneouslyand may project spots having different characteristics such as shape orcolour so that the processor could work out which spots were projectedby which illumination means. Having two illumination means gives some ofthe same benefits as described above as having two detectors. With oneillumination means objects in the background may be in the shadow ofobjects in the foreground and hence will not be illuminated by theillumination means. Therefore it would not be possible to generate anyrange information. Having two illumination means could avoid thisproblem. Further if the detector or detectors were at differentbaselines from the various illumination means the differing baselinescould again be used to help resolve range ambiguities.

The illumination means should ideally use a relatively low power sourceand produce a large regular array of spots with a large depth of field.A large depth of field is necessary when working with a large operatingwindow of possible ranges as is a wide angle of projection, i.e. spotsshould be projected evenly across a wide angle of the scene and not justilluminate a small part of the scene. Preferable the illumination meansprojects the array of spots in an illumination angle of between 60° to100°. Usefully the depth of field may be from 150 mm to infinity.

In a preferred embodiment therefore the illumination means comprises alight source arranged to illuminate part of the input face of a lightguide, the light guide comprising a tube having substantially reflectivesides and being arranged together with projection optics so as toproject an array of distinct images of the light source towards thescene. The light guide in effect operates as a kaleidoscope. Light fromthe source is reflected from the sides of the tube and can undergo anumber of reflection paths within the tube. The result is that multipleimages of the light source are produced and projected onto the scene.Thus the scene is illuminated with an array of images of the lightsource. Where the source is a simple light emitting diode the scene istherefore illuminated with an array of spots of light. The light guidekaleidoscope gives very good image replication characteristics andprojects images of the input face of the light guide in a wide angle,i.e. a large number of spots are projected in all directions. Furtherthe kaleidoscope produces a large depth of field and so delivers a largeoperating window.

The light guide comprises a tube with substantially reflective walls.Preferably the tube has a constant cross section which is conveniently aregular polygon. Having a regular cross section means that the array ofimages of the light source will also be regular which is advantageousfor ensuring the whole scene is covered and eases processing. A squaresection tube is most preferred. Typically, the light guide has a crosssectional area in the range of a few square millimetres to a few tens ofsquare millimetres, for instance the cross sectional area may be in therange of 1-50 mm² or 2-25 mm². As mentioned the light guide preferablyhas a regular shape cross section with a longest dimension of a fewmillimetres, say 1-5 mm. One embodiment as mentioned is a square sectiontube having a side length of 2-3 mm. The light guide may have a lengthof a few tens of millimetres, a light guide may be between 10 and 70 mmlong. Such light guides can generate a grid of spots over an angle of50-100 degrees (typically about twice the total internal angle withinthe light guide). Depth of field is generally found to be large enoughto allow operation from 150 mm out to infinity. Other arrangements oflight guide may be suitable for certain applications however.

The tube may comprise a hollow tube having reflective internal surfaces,i.e. mirrored internal walls. Alternatively the tube may be fabricatedfrom a solid material and arranged such that a substantial amount oflight incident at an interface between the material of the tube andsurrounding material undergoes total internal reflection. The tubematerial may be either coated in a coating with a suitable refractiveindex or designed to operate in air, in which case the refractive indexof the light guide material should be such that total internalreflection occurs at the material air interface.

Using a tube like this as a light guide results in multiple images ofthe light source being generated which can be projected to the scene toform the array of spots. The light guide is easy to manufacture andassemble and couples the majority of the light from the source to thescene. Thus low power sources such as light emitting diodes can be used.As the exit aperture can be small, the apparatus also has a large depthof field which makes it useful for ranging applications which requirespots projected that are separated over a wide range of distances.

Either individual light sources may be used close to the input face ofthe light guide to illuminate just part of the input face or one or morelight sources may be used to illuminate the input face of the lightguide through a mask. Using a mask with transmissive portion for passinglight to a part of the light guide can be easier than using individuallight sources. Accurate alignment of the mask is required at the inputface of the light guide but this may be easier than accurately aligningan LED or LED array.

Preferably where a mask is used the illumination means comprises ahomogensier located between the light source and the mask so as toensure that the mask is evenly illuminated. The light source maytherefore be any light source giving an acceptable level of brightnessand does not need accurate alignment.

The projection optics may comprise a projection lens. The projectionlens may be located adjacent the output face of the light guide. In someembodiments where the light guide is solid the lens may be integral tothe light guide, i.e. the tube may be shaped at the output face to forma lens.

All beams of light projected by the apparatus according to the presentinvention pass through the end of the light guide and can be thought ofas originating from the point at the centre of the end face of the lightguide. The projection optics can then comprise a hemispherical lens andif the centre of the hemisphere coincides with the centre of the lightguide output face the apparent origin of the beams remains at the samepoint, i.e. each projected image has a common projection origin. In thisarrangement the projector does not have an axis as such as it can bethought of a source of beams radiating across a wide angle. Thepreferred illumination means of the present invention is therefore quitedifferent from known structured light generators. What matters for theranging apparatus therefore is the geometrical relationship between thepoint of origin of the beams and the principal point of the imaging lensof the detector.

Preferably the projection optics are adapted so as to focus theprojected array at relatively large distances. This provides a sharpimage at large distances and a blurred image at closer distances. Asdiscussed above the amount of blurring can give some coarse rangeinformation which can be used to resolve ambiguities. The discriminationis improved if the light source illuminates the input face of the lightguide with a non circular shape, such a square. Either a square lightsource could be used or a light source could be used with a mask withsquare shaped transmissive portions.

In order to further remove ambiguity the light source may illuminate theinput of the light guide with a shape which is not symmetric about theaxes of reflection of the light guide. If the light source ortransmissive portion of the mask is not symmetrical about the axis ofreflection the image of the light source will be different to its mirrorimage. Adjacent spots in the projected array are mirror images and soshaping the light source or transmissive portions of the mask in thismanner would allow discrimination between adjacent spots.

The apparatus may comprise more than one light source, each light sourcearranged to illuminate part of the input face of the light guide. Usingmore than one light source can improve the spot resolution in the scene.Preferably the more than one light sources are arranged in a regularpattern. The light sources may be arranged such that differentarrangements of sources can be used to provide differing spot densities.For instance a single source could be located in the centre of the inputface of the light guide to provide a certain spot density. A separatetwo by two array of sources could also be arranged on the input face andcould be used instead of the central source to provide an increased spotdensity.

Alternatively the mask could be arranged with a plurality oftransmissive portions, each illuminate a part of the input face of thelight guide. In a similar manner to using multiple sources this canincrease spot density in the scene. The mask may comprise anelectro-optic modulator so that the transmission characteristics of anyof the transmissive portions may be altered, i.e. a window in the maskcould be switched from being transmissive to non-transmissive toeffectively switch certain spots in the projected array on and off.

Where more than one light sources are used at least one light sourcecould be arranged to emit light at a different wavelength to anotherlight source. Alternatively when using a mask with a plurality oftransmissive portions the different transmissive portions could transmitdifferent wavelengths. Using sources with different wavelengths ortransmissive windows operating at different wavelengths means that thearray of spots projected into a scene will have differing wavelengths,in effect the spots will be different colours—although the skilledperson will appreciate that the term colour is not meant to implyoperation in the visible spectrum. Having varying colours will helpremove ambiguity over which spot is which in the projected array.

Alternatively at least one light source could be shaped differently fromanother light source, preferably at least one light source having ashape that is not symmetric about a reflection axis of the light guide.Shaping the light sources again helps discriminate between spots in thearray and having the shapes non symmetrical means that mirror imageswill be different, further improving discrimination as described above.The same effect may be achieved using a mask by shaping the transmissiveportions appropriately.

At least one light source could be located within the light guide, at adifferent depth to another light source. The angular separation of theprojected array from a kaleidoscope is determined by the ratio of itslength to its width as will be described later. Locating at least onelight source within the kaleidoscope effectively shortens the effectivelength of light guide for that light source. Therefore the resultingpattern projected towards the scene will comprise more than one array ofspots having different periods. The degree of overlap of the spot willtherefore change with distance from the centre of the array which can beused to identify each spot uniquely.

The ranging system may also have a means for periodically redirectingthe array of spots in the scene. The means for redirecting the array ofspots in the scene is preferably adapted to displace the array of spotsin the scene so as to provide new range points. Therefore the scene maybe illuminated with an array of spots and the range to each of the spotsdetermined. The array of spots may then be displaced in the scene andthe range to each of the new spot positions also found. This can allowthe resolution of the image in ranging terms to be increased permittingvery accurate ranging of the scene.

The means for redirecting the array of spots in the scene may comprise ameans of moving or tilting the illumination means. Where theillumination means is moved the baseline between the detector andillumination means may be altered and obviously this will need to betaken into account by the processor in calculating the range to eachspot. Alternatively tilting the illumination means slightly may beachieved without changing the apparent baseline but resulting in aslight spot displacement

As an alternative to moving the illumination means at all the means forredirecting the array of spots may comprise an optical element locatedin the optical path of the illumination means. For instance a wedge ofrefractive material could be placed in the optical path closer to theprojection optics. The refractive wedge may act to deflect the radiationslightly from the path it would follow without the wedge present. Thewedge may therefore be inserted or withdrawn from the optical path toredirect the array in the scene. Alternatively the wedge could bearrange to be rotated about an axis so as to deflect incident radiationin different directions as the wedge is located. The wedge could beadapted to be rotated between fixed positions and the ranging systemadapted to acquire an image at each position. Thus a four fold increasein spot density can be achieved.

The ranging system of the present invention may further advantageouslycomprise a location sensor. Where the ranging apparatus is used in aportable device, such as a camera, it may be advantageous to know thelocation of the camera when an image is captured. Knowing the locationof the camera and the range to objects in the captured image thelocation of the objects in the scene can be determined. This may beuseful in a wide range of applications, especially where the capturedimages are being used to form a three dimensional model of a scene orobject. The location sensor may comprise a GPS (Global PositioningSystem) receiver to give a co-ordinate location or may comprise alocation sensor which determines location relative to some fixed point.For instance the location sensor may determine the location of theranging apparatus relative to a marker beacon which has been placed at afixed point.

The location sensor preferably determines the orientation of the sensor.This could be the orientation in terms of elevation of the rangingsystem, i.e. whether it is looking up or down and to what extent, or theazimuth of the system, i.e. whether it is looking east or west etc, orboth. The orientation may again be determined with respect to a markerbeacon. Any known orientation system may be used as will be understoodby a person skilled in the art, for instance compasses, tip/tiltsensors, magnetic field sensors etc. Inertial sensors may be used totrack motion of the ranging apparatus in order to determine the locationand/or orientation information.

When the positional and orientation information of an image is known andthe range to objects in the images is also known the images may be usedto form a three dimensional model of a scene. An object or a scene suchas a room could be imaged using the ranging apparatus of the presentinvention from several different views and the recorded images andpositional and range information used to form a three dimensional modelof the object or room.

Rather than track the location of a range finding apparatus of thepresent invention and take images of an object or scene from severaldifferent viewpoints in one embodiment of the present invention aplurality of range finding apparatuses according to the presentinvention may be arranged in fixed relation to each other to image avolume from different viewpoints. Imagine a plurality of range findingcameras according to the present invention are arranged in a known fixedrelation and image the same volume from different angles. Any objectplaced in this volume will be imaged from different angles by each ofthe range finding cameras and the range to the object surface determinedfor each view. The data from these images could then be used to create athree dimensional model of the object. This could be used in a widevariety of computer aided design or modelling or simulationapplications. The object need not be inanimate and could be the whole orpart of a person or animal. For instance a booth could be arranged withseveral cameras to image a person and determine biometric informationsuch as body size which could be used for clothes fitting, or a smallervolume could image feet say for shoe sizing or faces for recognitionpurposes.

The range finding apparatus according to the present invention could beused in a variety of applications. Surveying and mapping may be aidedusing the apparatus according to the present invention, especially theembodiment which records positional information. The invention could beimplemented with underwater imaging apparatus which could aid surveying,construction and marine archaeology.

Manufacturing processes could use ranging apparatus according to thepresent invention either for quality control or aiding automatedassembly. The apparatus could be used for aiding automatic navigationsuch as robotic vision, piloting of UAV/UUV (unmanned air/underwatervehicles) or automotive driving aids.

Security scanners and proximity alerts could use range information tohelp identify motion in a scene or classify an object in a scene. Theinvention could also be used for access control, an image of a person'sface could for instance be used as part of an access control means, areference image being used for comparison.

As the present invention allows very fast ranging information theranging apparatus could be used to analyse movement. For instance theaccess control application described above could include the subjectbeing recorded saying a password with the facial movements beingrecorded and analysed. The system could be combined with a speechrecognition apparatus for added security.

As mentioned previously the projected spots may be in other wavelengthsthan the visible spectrum. The detector must be able to detect the spotsbut it may also operate outside of the visible wavelength, for instancean infrared camera or ultraviolet could be used.

Whilst a processor is required to be able to determine the range pointsthe apparatus may comprise an image capture unit which simply capturesan image of the scene illuminated with the array of spots for laterprocessing. Therefore in another aspect of the invention there isprovided an image recorder having a large depth of field comprising anillumination means for illuminating a scene with an array of spots andan imaging array for recording an image of the scene characterised inthe illumination means is adapted to illuminate the scene such that thelocation of spots in the recorded image can be used to give adetermination of range without any ambiguity. When the apparatus doesnot have an integral processor it is obviously not possible to locateany possible ambiguity at the time and so the illumination means isadapted to illuminate the scene such that there will be no ambiguity inrange determination. All of the apparatus, methods and featuresdescribed above with respect to the first aspect of the invention toremove ambiguity may be used in this aspect of the invention includingshaped spots focussed at certain ranges, coloured spots, differentlycoloured spots and multiple viewpoints/imaging arrays. This aspect ofthe invention may also employ the same techniques as the first aspect ofthe invention for improving spot density resolution such as redirectingthe spot array or activating different arrays at different times. Theillumination means of this aspect of the invention is preferably theillumination means described with reference to the first aspect of theinvention.

In another aspect of the invention there is provided a method ofobtaining range information about a scene comprising the steps ofilluminating the scene with an array of spots, taking an image of thespots in the scene, uniquely identifying each spot in the scene anddetermining, from the location of each spot in the scene the range tothat spot.

The method may involve the step of illuminating the scene with spotswhich have a non-circular shape and which are focussed at one range inthe operating window and unfocussed at another range in the operatingwindow and the step of uniquely identifying each spot in the sceneinvolves determining whether the spot is focussed or not.

The method may also involve the step of projecting the array of spotssuch that at least some of the projected spots are of a different shapeand/or colour to other spots and the step of uniquely identifying eachspot in the scene involves determining the colour and or shape of aspot.

The step of recording an image of the scene may comprise the step ofrecording an image of the scene from a plurality of viewpoints with thesame illumination. In which case the step of uniquely identifying eachspot in the scene may comprise the step of comparing the position of aspot from more than one viewpoint so as to uniquely identify that spot.

The method may further comprise the step of recording information aboutthe position from which the image was recorded for each recorded image.

Where range information is acquired from the scene, for instance fromimages acquired of a particular object the information relating to theshape of the detected object could be compared to reference shapes orshape models, for instance for recognition purposes. Thus according toanother aspect of the invention there is provided a method ofidentification comprising the step of obtaining range information abouta scene according to the method described above and comparing said rangeinformation with reference shape information corresponding to an item tobe identified and giving an indication of quality of match of thedetected shape to the reference item. The matching step may use modelcoefficients or best fit methods. The item to be identified could beanything which it is wished to identify or recognise—for instance aproduct on a production line could be compared with a good product forquality control purposes with a bad match triggering an alarm.

The invention will now be described by way of example only withreference to the following drawings of which;

FIG. 1 shows a prior art single spot ranging system,

FIG. 2 shows an embodiment of the ranging system of the presentinvention,

FIG. 3 shows a suitable spot projector for use in the ranging system ofthe present invention,

FIG. 4 illustrates the principle of operation of the spot projectorshown in FIG. 3,

FIG. 5 shows an alternative spot projector and the output thereof,

FIG. 6 shows the input face of a spot projector having variable spotdensity projection,

FIG. 7 shows the input face of an alternative type of suitable spotprojector and the pattern produced therefrom,

FIG. 8 shows another suitable spot projector,

FIG. 9 shows an embodiment of the invention using two cameras,

FIG. 10 shows the input face of a spot projector for producing spotsformed from the intersection of continuous lines,

FIG. 11 shows another embodiment of a spot projector suitable for use inthe present invention,

FIG. 12 shows a means for redirecting the output of the spot projectorso as to increase spot density, and,

FIG. 13 shows a three camera ranging system according to the presentinvention.

FIG. 1 shows a prior art ranging system using a single spot. A scanningsource 2 produces a single beam of light 4 which is projected towards ascene. Detector 6 looks towards the scene and detects where in the scenethe spot is located. FIG. 1 a shows the apparatus with a target 8 at afirst range and also illustrates the scene 10 as it appears to thedetector. The spot 12 can be seen at a particular location governed bythe angle θ₁ which is itself determined by the range to the object.

FIG. 1 b shows the same apparatus when target 8 is removed and a newtarget 14 is introduced further away. The new angle θ₂ to the spot islower than θ₁ and so the detector 6 sees the spot 12 in a differentlocation. The apparent movement of the spot in the scene is shown byarrow 16.

It can be seen then that when a beam of light is projected at a knownangle from the scanning source 2 the location of the spot 12 in thedetected scene 10 can give range information. As the range of the targetis varied the spot appears to move across the scene. The spot thereforehas a locus of apparent movement across the scene with varying rangewhich is determined by the arrangement of the source 2 and detector 6.

The prior art is limited however in that the spot must be scanned acrossthe whole of the scene to generate range information from across thescene. Scanning requires complicated mechanical systems and means thatranging to the entire scene takes a relatively long time.

The present invention uses a two dimensional array of spots to gainrange information from the whole scene simultaneously. Using a twodimensional array of spots can lead to ambiguity problems as illustratedwith reference to FIG. 2 a. Here like components to FIG. 1 have likenumerals. The arrangement is the same except for the fact that scanningsource 2 is replaced with a two dimensional spot projector 22 andprocessor 7 is indicated. The spot projector 22 projects a plurality ofangularly separated beams 24 a, 24 b (only two are shown for clarity).Where the scene is a flat target the image 10 the detector sees is asquare array of spots 12. As can be seen from FIG. 2 a though a spotappearing at a particular location in the scene, say that received atangle θ₁, could correspond to a first projected spot, that from beam 24b, being reflected or scattered from a target 8 at a first range or asecond, different projected spot, that from beam 24 a, being reflectedor scattered from a target 14 at a more distant range. Again each spotin the array can be thought of as having a locus in the scene of varyingrange. It can be seen that the locus for one spot, arrow 26, can overlapwith the position of other spots, giving rise to range ambiguity.

One embodiment of the present invention avoids this problem by arrangingthe spot projector relative to the detector such that the array of spotsis projected such that the loci of possible positions in the detectedscene at varying range of adjacent spots do not overlap. FIG. 2 btherefore shows the apparatus of the present invention from a sideelevation. It can be seen that the detector 6 and spot projector 22 areseparated in the y-direction as well as the x-direction. Therefore they-position of a spot in the scene also varies with range, which has aneffect on the locus of apparent spot motion. The arrangement is chosensuch that the loci of adjacent spots do not overlap. The actual locus ofspot motion is indicated by arrow 28. The same effect can be achieved byrotating the projector about its axis.

Another way of thinking of this would be to redefine the x-axis as theaxis along which the detector and spot projector are separated, or atleast the effective input/exit pupils thereof if mirrors or otherdiverting optical elements were used. The z-axis is the range to thescene to be measured and the y-axis is orthogonal. The detectortherefore forms a two dimensional x-y image of the scene. In thisco-ordinate system there is no separation of the detector and projectorin the y-direction and so a spot projected by the projector at a certainangle in the z-y plane will always be perceived to be at that angle bythe detector, irrespective of range, i.e. the spot will only appear tomove in the detected scene in a direction parallel to the x-direction.If the array is therefore arranged with regard to the x-axis such thatadjacent spots have different separations in the y-direction there willbe no ambiguity between adjacent spots. Where the array is a squarearray of spots this would in effect mean tilting the array such that anaxis of the array does not lie along the x-axis as defined, i.e. theaxis by which the detector and spot projector are separated.

For wholly unambiguous determination of which spot is which the spotsize, inter-spot gap and arrangement of the detector would be such thatthe locus of each spot did not overlap with the locus of any other spot.However for practical reasons of discrimination a large number of spotsis preferable with a relatively large spot size and the apparatus isused with a large depth of field (and hence large apparent motion of aspot in the scene). In practice then the loci of different spots willsometimes overlap. As can be seen in FIG. 2 b the locus of projectedspot 30 does overlap with projected spot 32 and therefore a spotdetected in the scene along the line of arrow 28 could correspond toprojected spot 30 at one range or projected spot 32 at a differentrange. However the difference in the two ranges will be significant. Insome applications the ranging system may only be used over a narrow bandof possible ranges and hence within the operating window there may be noambiguity. However for most applications it will be necessary to resolvethe ambiguity. As the difference in possible ranges is relatively largehowever a coarse ranging technique could be used to resolve theambiguity over which spot is being considered with the ranging systemthen providing accurate range information based on the location ofuniquely identified spots.

In one embodiment spot projector 22 projects an array of square shapedspots which is focussed at relatively long range. If the processor seessquare spots in the detected scene this means that the spots aresubstantially focussed and so the detected spot must consequently be onewhich is at relatively long range. However if the observed spot is atclose range it will be substantially unfocussed and will appearcircular. A focal length of 800 mm may be typical. Thus the appearanceof the spot may be used to provide coarse range information to removeambiguity over which spot has been detected with the location of thespot then being used to provide fine range information.

The detector 6 is a standard two dimensional CCD array, for instance astandard CCD camera although a CMOS camera could be used instead. Thedetector 6 should have sufficient resolution to be able to identify thespots and the position thereof in the scene. The detector 6 may beadapted to capture a visible image as well as detect the spots in thescene. Once the range information has been processed to determine therange information in the image and hence generate a 3D surface thevisible data can subsequently be superimposed on the 3D surface togenerate surface details/texture, or in the case of faces, a “3D mask”.

The spot projector may project spots in the visible waveband which maybe detected by a camera operating in the visible band. However the spotprojector may project spots at other wavelengths, for instance infraredor ultraviolet. Where the spot projector projects infrared spots ontothe scene the detector used is a CCD camera with four elements to eachpixel group. One element detects red light, another blue light and athird green light. The fourth element in the system is adapted to detectinfrared light at the appropriate wavelength. Thus the readout from theRGB elements can be used to form a visible image free from any spots andthe output of the infrared elements, which effectively contains only theinfrared spots, provided to the processor to determine range. Wherespots are projected at different wavelengths however as will bedescribed later the detector must be adapted to distinguish betweendifferent infrared wavelengths, in which case a different camera may bepreferred. The detector is not limited to working in the visible bandeither. For instance a thermal camera may be used. Provided the detectoris able to detect the projected spots it doesn't matter whether thedetector also has elements receiving different wavelengths.

In order to aid spot detection and avoid problems with ambient light thespot projector is adapted to project a modulated signal. The processoris adapted to filter the detected signal at the modulation frequency toimprove the signal to noise ratio. The simplest realisation of thisprinciple is to use a pulsed illumination, known as strobing or flashillumination. The camera captures one frame when the pulse is high. Areference pulse is also taken without the spots projected. Thedifference of these intensity patterns is then corrected in terms ofbackground lighting offsets. In addition a third reflectivity referenceframe could be collected when synchronised to a uniformly illuminatedLED flashlamp which would allow a normalisation of the intensitypattern.

A suitable spot projector 22 is shown in FIG. 3. A light source 34 islocated adjacent an input face of a kaleidoscope 36. At the other end islocated a simple projection lens 38. The projection lens is shown spacedfrom the kaleidoscope for the purposes of clarity but would generally belocated adjacent the output face of the kaleidoscope.

The light source 34 is an infrared emitting light emitting diode (LED).As discussed above infrared is useful for ranging applications as thearray of projected spots need not interfere with a visual image beingacquired and infrared LEDs and detectors are reasonably inexpensive.However the skilled person would appreciate that other wavelengths andother light sources could be used for other applications withoutdeparting from the spirit of the invention.

The kaleidoscope is a hollow tube with internally reflective walls. Thekaleidoscope could be made from any material with suitable rigidity andthe internal walls coated with suitable dielectric coatings. However theskilled person would appreciate that the kaleidoscope couldalternatively comprise a solid bar of material. Any material which istransparent at the wavelength of operation of the LED would suffice,such as clear optical glass. The material would need to be arranged suchthat at the interface between the kaleidoscope and the surrounding airthe light is totally internally reflected within the kaleidoscope. Thismay be achieved using additional (silvering) coatings, particularly inregions that may be cemented with potentially index matchingcements/epoxys etc. Where high projection angles are required this couldrequire the kaleidoscope material to be cladded in a reflectivematerial. An ideal kaleidoscope would have perfectly rectilinear wallswith 100% reflectivity. It should be noted that a hollow kaleidoscopemay not have an input or output face as such but the entrance and exitto the hollow kaleidoscope should be regarded as the face for thepurposes of this specification.

The effect of the kaleidoscope tube is such that multiple images of theIED can be seen at the output end of the kaleidoscope. The principle isillustrated with reference to FIG. 4. Light from the LED 34 may betransmitted directly along the kaleidoscope undergoing no reflection atall—path 40. Some light however will be reflected once and will followpath 42. Viewed from the end of the kaleidoscope this will result in avirtual source 44 being seen. Light undergoing two reflections wouldtravel along path 46 resulting in another virtual source 48 beingobserved.

The dimensions of the device are tailored for the intended application.Imagine that the LED 34 emits light into a cone with a full angle of90°. The number of spots viewed on either side of the centre,unreflected, spot will be equal to the kaleidoscope length divided byits width The ratio of spot separation to spot size is determined by theratio of kaleidoscope width to LED size. Thus a 200 μm wide LED and akaleidoscope 30 mm long by 1 mm square will produce a square grid of 61spots on a side separated by five times their width (when focussed). Thespot projector may typically be a few tens of millimetres long and havea square cross section with a side in the range of 2 to 5 mm long, say 3to 4 mm square. For typical applications the spot projector is designedto produce an array of 40×30 spots or greater to be projected to thescene. A 40 by 30 array generates up to 1200 range points in the scenealthough 2500 range points may preferred with the use of intersectionlines allowing up to 10,000 range points.

Projection lens 38 is a simple singlet lens arranged at the end ofkaleidoscope and is chosen so as to project the array of images of theLED 34 onto the scene. The projection geometry again can be chosenaccording to the application and the depth of field required but asimple geometry is to place the array of spots at or close to the focalplane of the lens. The depth of field of the projection system isimportant as it is preferable to have a large depth of field to enablethe ranging apparatus to accurately range to objects within a largeoperating window. A depth of field of 150 mm out to infinity isachievable and allows useful operating windows of range to bedetermined.

As mentioned LED 34 may be square in shape and projection lens 38 couldbe adapted to focus the array of spots at a distance towards the upperexpected range such that the degree of focus of any particular spot canyield coarse range information.

A spot projector as described has several advantages. The kaleidoscopeis easy and inexpensive to manufacture. LEDs are cheap components and asthe kaleidoscope efficiently couples light from the LED to the scene arelatively low power source can be used. The spot projector as describedis therefore an inexpensive and reasonably robust component and alsogives a large depth of focus which is very useful for rangingapplications. A kaleidoscope based spot projector is thus preferred forthe present invention. Further the spot projector of the presentinvention can be arranged so as to effectively have no specific axis. Asillustrated with respect to FIG. 4 all beams of light emitted by thespot projector pass through the end of the kaleidoscope and can bethought of as passing through the centre of the output face. Whereprojection lens 38 is a hemispherical lens with its axis of rotationcoincident with the centre of the output face (as better shown in FIG. 5with integral lens 58) then all beams of light appear to originate fromthe output face of the kaleidoscope and the projector acts as a wideangle even projector.

The skilled person would appreciate however that other spot projectorscould be used to generate the two dimensional array. For instance alaser could be used with a diffractive element to generate a diffractionpattern which is an array of spots. Alternatively a source could be usedwith projection optics and a mask having an array of apertures therein.Any source that is capable of projecting a discrete array of spots oflight to the scene would suffice, however the depth of field generatedby other means, LED arrays, microlens arrays, projection masks etc., hasgenerally been found to be very limiting in performance.

An apparatus as shown in FIG. 2 was constructed using a spot projectoras shown in FIG. 3. The spot projector illuminated the scene with anarray of 40 by 30 spots. The operating window was 60° full angle. Thespots were focussed at a distance of 1 m and the ranging device workedwell in the range 0.5 m to 2 m. The detector was a 308 kpixel (VGA) CCDcamera. The range to different objects in the scene were measured to anaccuracy of 0.5 mm at mid range.

Before the apparatus as described above can be used to produce rangedata, it must first be calibrated. In principle, the calibration can begenerated from the geometry of the system. In practice, it is moreconvenient to perform a manual calibration. This allows forimperfections in construction and is likely to produce better results.

Calibration data are obtained by placing a test object at a series ofknown distances and recording the spot positions as a function of range.The most convenient test object is a flat, matt plane of uniform colour,preferably white, which fills the field of view of the camera at allranges. A flat white wall would be ideal (obviously the camera wouldmove in this case), however any deviations from flatness would affectthe accuracy of the calibration.

Initially, the camera is placed at a large distance from the wall, about1.5 m would do for the system described above, and the location of eachspot in the image is recorded (spot-finding algorithms are describedbelow). As the camera moves closer to the wall all the spots in theimage move in roughly the same direction so it is a fairly simple matterto track them. The spots move along a straight line in the image as isapparent from the explanations above. A linear regression provides theformula for the track of each line in the form:b=ma+cwhere the coordinates of the spot are (a,b).

The design of the kaleidoscope projector ensures that all beams appearto originate from a common origin. Therefore, all the tracks of thespots intersect at a common point, which is the projection of the beamorigin, through the principal point of the camera lens, onto the camerafocal plane. This track origin can be calculated by finding theintersection of the measured spot tracks. In practice, the spot tracksare unlikely to all intersect at the same point due to uncertainties inthe measurements. It is sufficient to select one of the tracks and findthe intersection point of this track with all the others. This willproduce a series of values for the coordinates of the origin. Theposition of the origin can then be determined by selecting the medianvalue of each coordinate.

The next stage in the calibration procedure is to determine anidentifier, i, for each track, which can be used for determining theidentity of spots when the camera is used to produce range data. Twopossible identifiers have been identified. If the spot tracks are allparallel then the gradient, m, of all the lines is the same. Theintercept, c, is then the identifier. If the tracks are not parallel,then the angle between the line joining the midpoint of each track tothe track origin and the x-axis is the identifier. The final stage ofthe calibration is to determine the relationship between the spotposition along a track and the range. This can be found according to theformula:z−z ₀ =k/(r−r ₀)where z is the range along the z-axis and r is the position of the spotalong the track. The position r can be measured along any convenientaxis but the most convenient measure is to express r as a distance fromthe track origin. The constants k, z₀ and r₀ for each track can be foundby fitting the formula above to the measured data. In a well-alignedsystem, the values for k and z₀ should be similar for all tracks.

The outcome of the calibration procedure consists of the track originand a list of six numbers for each track: i, m, c, k, r₀, z₀.

After calibration the system is ready to determine range. The rangefinding algorithm consists of four basic stages. These are: 1 Normalisethe image 2 Locate the spots in the image. 3 Identify the spots 4Calculate range dataNormalisation

Since the camera has been filtered to select only light from thekaleidoscope, there should be a very low level of background light inthe image. Therefore, any regions that are bright in comparison to thelocal background can be reasonably expected to be spots. However, therelative brightnesses of different spots will vary according to therange, position and reflectivity of the target. It is thereforeconvenient as a first step to normalise the image to remove unwantedbackground and highlight the spots. The normalisation procedure consistsof calculating the ‘average’ intensity in the neighbourhood of eachpixel, dividing the signal at the pixel by its local average and thensubtracting unity. If the result of this calculation is less than zero,the result is set to zero.

Spot Location

Spot location consists of two parts. The first is finding the spot. Thesecond is determining its centre. The spot-finding routine maintains twocopies of the normalised image. One copy (image A) is changed as morespots are found. The other (image B) is fixed and used for locating thecentre of each spot. As it is assumed that all bright features in thenormalised images are spots, the spots can be found simply by locatingall the bright regions in the image. The first spot is assumed to benear the brightest point in image A. The coordinates of this point areused to determine the centre of the spot and an estimate of the size ofthe spot (see below). The intensity in the region around the spot centre(based on the estimated spot size) is then set to zero in image A. Thebrightest remaining point in image A is then used to find the next spotand so on.

The spot-finding algorithm described above will find spots indefinitelyunless extra conditions are imposed. Three conditions have beenidentified, which are used to terminate the routine. The routineterminates when any of the conditions is met. The first condition isthat the number of spots found should not exceed a fixed value. Thesecond condition is that the routine should not repeatedly find the samespot. This occurs occasionally under some lighting conditions. The thirdcondition is that the intensity of the brightest point remaining inimage A falls below a predetermined threshold value. This conditionprevents the routine from finding false spots in the picture noise.Usually the threshold intensity is set to a fraction (typically 20%) ofthe intensity of the brightest spot in image B.

The centre of each spot is found from image B using the locationdetermined by the spot-finding routine as a starting point. A sub-imageis taken from image B, centred on that point. The size of the sub-imageis chosen to be slightly larger than the size of a spot. The sub-imageis reduced to a one-dimensional array by adding the intensity values ineach column. The array (or its derivative) is then correlated with agaussian function (or it's derivative) and the peak of the correlation(interpolated to a fraction of a pixel) is defined as the centre of thespot in the horizontal direction. The centre of the spot in theorthogonal direction is found in a similar manner by summing rows in thesub-image instead of columns.

If the centre of the spot determined by the procedure above is more thantwo pixels away from the starting point, the procedure should berepeated iteratively, using the calculated centre as the new startingpoint. The calculation continues until the calculated position remainsunchanged or a maximum number of iterations is reached. This allows forthe possibility that the brightest point is not at the centre of thespot. A maximum number of iterations (typically 5) should be used toprevent the routine from hunting in a small region. The iterativeapproach also allows spots to be tracked as the range to an objectvaries, provided that the spot does not move too far between successiveframes. This feature is useful during calibration.

Having found the centre of the spot, the number of pixels in thesub-image with an intensity greater than a threshold value (typically10% of the brightest pixel in the sub-image) is counted. The spot sizeis defined as the square root of this number, and may be used foradditional coarse range information.

The outcome of the spot locating procedure is a list of (a,b)coordinates, each representing a different spot.

Spot Identification

The range to each spot can only be calculated if the identity of thespot can be determined. The simplest approach to spot identification isto determine the distance from the spot to each spot track in turn andeliminate those tracks that lie outside a pre-determined distance(typically less than one pixel for a well-calibrated system). Thisapproach may be time-consuming when there are many spots and manytracks. A more efficient approach is to calculate the identifier for thespot and compare it with the identifiers for the various tracks. Sincethe identifiers for the tracks can be pre-sorted, the search can be mademuch quicker. The identifier is calculated in the same way as in thecalibration routine.

Once candidate tracks have been identified, it is necessary to considerthe position of the spot along the track. If the range of possibledistances is limited, (e.g. nothing can be closer than, say, 150 mm orfurther than 2500 mm) then many of the candidate tracks will beeliminated since the calculated range will be outside possibleboundaries. In a well-adjusted system, at most two tracks should remain.One track will correspond to a short range and the other to a muchlonger range.

A final test is to examine the shape of the spot in question. Asdescribed the projector 22 produces spots that are focussed at longranges and blurred at short ranges. Provided that the LEDs in theprojector have a recognisable shape (such as square) then the spots willbe round at short distances and shaped at long distances. This shouldremove any remaining range ambiguities.

Any spots that remain unidentified are probably not spots at all butunwanted points of light in the scene.

Range Calculation

Once a spot has been identified, its range can be calculated. In orderto produce a valid 3-dimensional representation of the scene it is alsonecessary to calculate x and y-coordinates. These can simply be derivedfrom the camera properties. For example, for a camera lens of focallength f with pixel spacing p, the x- and y-coordinates are simply givenby:x=zap/f,y=zbp/fwhere a and b are measured in pixel coordinates.

The embodiment described above was adjusted so as to have minimalambiguity between possible spots and use focus to resolve the ambiguity.Other means of resolving ambiguity may be employed however. In oneembodiment of the invention the apparatus includes a spot projectorgenerally as described with reference to FIG. 3 but in which the lightsource is shaped so as to allow discrimination between adjacent spots.Where the light source is symmetric about the appropriate axes ofreflection the spots produced by the system are effectively identical.However where a non symmetrically shaped source is used adjacent spotswill be distinguishable mirror images of each other. The principle isillustrated in FIG. 5.

The structured light generator 22 comprises a solid tube of clearoptical glass 56 having a square cross section. A shaped LED 54 islocated at one face. The other end of tube 56 is shaped into ahemispherical projection lens 58. Kaleidoscope 56 and lens 58 aretherefore integral which increases optical efficiency and easesmanufacturing as a single moulding step may be used. Alternatively aseparate lens could be optically cemented to the end of a solidkaleidoscope with a plane output face.

For the purposes of illustration LED 54 is shown as an arrow pointing toone corner of the kaleidoscope, top right in this illustration. Theimage formed on a screen 60 is shown. A central image 62 of the LED isformed corresponding to an unreflected spot and again has the arrowpointing to the top right. Note that in actual fact a simple projectionlens will project an inverted image and so the images formed wouldactually be inverted. However the images are shown not inverted for thepurposes of explanation. The images 64 above and below the central spothave been once reflected and therefore are a mirror image about thex-axis, i.e. the arrow points to the bottom right. The next images 66above or below however have been twice reflected about the x-axis and soare identical to the centre image. Similarly the images 68 to the leftand right of the centre image have been once reflected with regard tothe y-axis and so the arrow appears to point to the top left. The images70 diagonally adjacent the centre spot have been reflected once aboutthe x-axis and once about the y-axis and so the arrow appears to pointto the bottom left. Thus the orientation of the arrow in the detectedimage gives an indication of which spot is being detected. Thistechnique allows discrimination between adjacent spots but notsubsequent spots.

In another embodiment more than one light source is used. The lightsources could be used to give variable resolution in terms of spotdensity in the scene, or could be used to aid discrimination betweenspots, or both.

For example if more than one LED were used and each LED was a differentcolour the pattern projected towards the scene would have differentcoloured spots therein. The skilled person would appreciate that theterm colour as used herein does not necessarily mean differentwavelengths in the visible spectrum but merely that the LEDs havedistinguishable wavelengths.

The arrangement of LEDs on the input face of the kaleidoscope effectsthe array of spots projected and a regular arrangement is preferred. Toprovide a regular array the LEDs should be regularly spaced from eachother and the distance from the LED to the edge of the kaleidoscopeshould be half the separation between LEDs.

FIG. 6 shows an arrangement of LEDs that can be used to give differingspot densities. Thirteen LEDs are arranged on the input face 72 of asquare section kaleidoscope. Nine of the LEDs, 76 & 74 a-h, are arrangedin a regular 3×3 square grid pattern with the middle LED 76 centred inthe middle of the input face. The remaining four LEDs, 78 a-d arearranged as they would be to give a regular 2×2 grid. The structuredlight generator can then be operated in three different modes. Eitherthe central LED 76 could be operated on its own, this would project aregular array of spots as described above, or multiple LEDs could beoperated. For instance, the four LEDs 78 a-d arranged in the 2×2arrangement could be illuminated to give an array with four times asmany spots produced than with the centre LED 76 alone.

The different LED arrangements could be used at different ranges. Whenused to illuminate scenes where the targets are at close range thesingle LED may generate a sufficient number of spots for discrimination.At intermediate or longer ranges however the spot density may drop belowan acceptable level, in which case either the 2×2 or 3×3 array could beused to increase the spot density. As mentioned the LEDs could bedifferent colours to improve discrimination between different spots.

Where multiple sources are used appropriate choice of shape or colour ofthe sources can give further discrimination. This is illustrated withrespect to FIG. 7. Here a 2×2 array of differently shaped sources, 82,84, 86, 88 is illustrated along with a portion of the pattern produced.One can think of the resultant pattern formed as a tiled array of imagesof the input face 80 of the kaleidoscope with each adjacent tile being amirror image of its neighbour about the appropriate axis. Looking justin the x-axis then the array will be built up by spots corresponding toLEDs 82 and 84 and followed by spots corresponding to their mirrorimages. The resultant pattern means that each spot is different from itsnext three nearest neighbours in each direction and ambiguity over whichspot is being observed by a detector would be reduced.

Where multiple sources are used the sources may be arranged to beswitched on and off independently to further aid in discrimination. Forinstance several LEDs could be used, arranged as described above, witheach LED being activated in turn. Alternatively the array couldgenerally operate with all LEDs illuminated but in response to a controlsignal from the processor which suggests some ambiguity could be used toactivate or deactivate some LEDs accordingly.

All of the above embodiments using shaped LEDs or LEDs or differentcolours can be combined with appropriate arrangement of the detector andspot projector such that where the locus of a spot overlaps with anotherspot the adjacent spots on that locus have different characteristics.For example, referring back to FIG. 2 b it can be seen that thearrangement is such that the locus of spot 30 overlaps with spot 32,i.e. a spot detected at the position of spot 32 shown could correspondto projected spot 32 reflected from a target at a first range orprojected spot 30 reflected from a target at a different range. Howeverimagine that the spot projector of FIG. 5 were used. It can been seenthat if projected spot 30 were an arrow pointing to the upper right thenprojected spot 32, but virtue of its position in the array, would be anarrow pointing to the upper left. Thus there would be no ambiguity overwhich spot was which as the direction of the arrow would indicate whichspot was being observed.

In an alternative embodiment of spot projector shown in FIG. 11 a lightsource 130 illuminates the kaleidoscope 136 through mask 132. Thekaleidoscope 136 and projection lens 138 may be the same as describedabove with reference to FIG. 5. Light source 130 is a bright LED sourcearranged to illuminate mask 132 through homogeniser 134. Homogeniser 134simply acts to ensure uniform illumination of mask 132 and so may is asimple and relatively inexpensive plastic light pipe.

Mask 132 is arranged to have a plurality of transmissive portions, i.e.windows, so that only part of the light from the LED 130 is incident onthe input face of the kaleidoscope 136. A suitable mask is illustratedas 132 a which has a plurality of apertures 142 for transmitting light.Each aperture will act as a separate light source in the same manner asdescribed above with respect to FIG. 6 and so the kaleidoscope willreplicate an image of the apertures in the mask 132 a and project anarray of spots onto the scene.

Mask 132 may be fabricated and accurately aligned with respect to thekaleidoscope 136 more easily than an LED array which would require smallLEDs. Thus the manufacture of the spot projector may be simplified byuse of a mask. The transmissive portions of the mask may be shaped so asto act as shaped light sources as described above with respect to FIGS.5 and 7. Therefore the mask may allow an array of spots of differentshapes to be projected and shaping of the transmissive portions of themask may again be easier than providing shaped light sources.

Further the different transmissive portions of the mask may transmit atdifferent wavelengths, i.e. the windows may have different colouredfilters. Mask 132 c shows an array having windows of two differentcolours, windows 144 may be red say whilst windows 146 may be green.Again however the invention is not limited to particular colours noroperation in the visible waveband.

Some of the transmissive windows may have a transmission characteristicwhich can be modulated, for instance the mask may comprise anelectro-optic modulator. Certain windows in the mask may then beswitched from being transmissive to non transmissive so as to deactivatecertain spots in the projected array. This could be used in a similarfashion to the various arrays described with reference to FIG. 6 to givedifferent spot densities or could be used to deactivate certain spots inthe array so as to resolve a possible ambiguity.

In a further embodiment light sources are arranged at different depthswithin the kaleidoscope. The angular separation of adjacent beams fromthe kaleidoscope depends upon the ratio between the length and width ofthe kaleidoscope as discussed above. FIG. 8 shows a square sectionkaleidoscope 96 and projection lens 98. The kaleidoscope tube 96 isformed from two pieces of material 96 a and 96 b. A first LED 98 islocated at the input face of the kaleidoscope as discussed above. Asecond LED 100 is located at a different depth within the kaleidoscope,between the two sections 96 a and 96 b of the kaleidoscope. The skilledperson would be well aware of how to join the two sections 96 a and 96 bof kaleidoscope to ensure maximum efficiency and located the second LED100 between the two sections.

The resulting pattern contains two grids with different periods, thegrid corresponding to the second LED 100 partially obscuring the gridcorresponding to the first LED 98. As can be seen the degree ofseparation between the two spots varies with distance from the centrespot. The degree of separation or offset of the two grids could then beused to identify the spots uniquely. The LEDs 98, 100 could be differentcolours as described above to improve discrimination.

It should be noted that the term spot should be taken as meaning a pointof light which is distinguishable. It is not intended to limit to anentirely separate area of light.

FIG. 10 for instance illustrates an alternative spot projector thatcould be used. Here a cross shaped LED 120 is used on the input face ofthe kaleidoscope. The LED 120 extends to the side walls of thekaleidoscope and so the projected pattern will be a grid of continuouslines 122 as illustrated. The intersection of the lines provides anidentifiable area or spot which can be located and the range determinedin the same manner as described above.

Once the range to the intersection has been determined the range to anypoint on the line passing through that intersection can be determinedusing the information gained from the intersection point. Thus theresolution of the system is greatly magnified. Using the same 40×30projection system described above but with the LED arrangement shown inFIG. 10 there are 1200 intersection points which can be identified to asystem with far more range points. The apparatus could be used thereforewith the processor arranged to identify each intersection point anddetermine the range thereto and then work out the range to each point onthe connecting lines. Alternatively the cross LED could comprise aseparate centre portion 124 which can be illuminated separately.Illumination of the central LED portion 124 would cause an array ofspots to be projected as described earlier. Once the range to each spothad been determined the rest of cross LED 120 could be activated and therange to various points on the connecting lines determined. Having thecentral portion only illuminated first may more easily allow ambiguitiesto be resolved based on shaped of the projected spots. An intersectingarray of lines can also be produced using a spot projector having a masksuch as shown in FIG. 11. Mask 132 c shows a suitable mask for producingan array of lines. Again parts of the mask may be switchable so as toswitch between a spot array and the array of lines if required.

Another embodiment of the invention is shown in FIG. 9. Here two CCDcameras 6, 106 are used to look at the scene. Spot projector 22 may beany of the spot projectors described above and projects a regular arrayof spots or crosses. CCD camera 6 is the same as described above withrespect to FIG. 2. A second camera 106 is also provided which isidentical to camera 6. A beamsplitter 104 is arranged so as to pass somelight from the scene to camera 6 and reflect some light to camera 106.The arrangement of camera 106 relative to beamsplitter 104 is such thatthere is a small difference 108 in the effective positions of the twocameras. Each camera therefore sees a slightly different scene. If thecamera positions were sufficiently far removed the beamsplitter 104could be omitted and both cameras could be oriented to look directlytowards the scene but the size of components and desired spacing may notallow such an arrangement.

The output from camera 6 could then be used to calculate range to thescene as described above. Camera 106 could also be used to calculaterange to the scene. The output of each camera could be ambiguous in themanner described above in that a detected spot may correspond to any ofone of a number of possible projected spots at different ranges. Howeveras the two cameras are at different spacings the set of possible rangescalculated for each detected spot will vary. Thus for any detected spotonly one possible range, the actual range, will be common to the setscalculated for each camera.

When camera 6 is located with a very small baseline, i.e. separation ofline of sight, from the spot projector the corresponding loci ofpossible positions of spots in the scene at different ranges are small.Referring back to FIG. 2 a it can be seen that if the separation fromthe detector 6 to the spot projector 22 is small the apparent movementin the scene of a spot at different ranges will not be great. Thus thelocus will be small and there may be no overlap between loci ofdifferent spots in the operating window, i.e. no ambiguity. However alimited locus of possible positions means that the system is not asaccurate as one with a greater degree of movement. For a system withreasonable accuracy and range a baseline of approximately 60 mm would betypical. Referring to FIG. 9 then if camera 6 is located close to theline of sight of the spot projector the output from camera 6 would be anon ambiguous but low accuracy measurement. Camera 106 however may belocated at an appropriate baseline from the spot projector 22 to giveaccurate results. The low accuracy readings from the output from camera6 could be used to resolve any ambiguity in the readings from camera106.

Alternatively the outputs from the two camera themselves could be usedto give coarse ranging. If the arrangement is such that the baselinebetween the cameras is small, say about 2 mm, the difference in detectedposition of a spot in the two cameras can be used to give a coarseestimate of range. The baseline between either camera and the projectormay be large however. The advantage of this configuration is that thetwo cameras are looking at images with very small differences betweenthem. The camera to projector arrangement needs to determine spotlocation by correlation of the recovered spot with a stored gaussianintensity distribution to optimise the measurement of the position ofthe spot. This is reasonable but never a perfect match as the spot sizeschange with range and reflectivity may vary across the spot. Surfaceslope of the target may also effect the apparent shape. The camera tocamera system looks at the same, possibly distorted spot, from twoviewpoints which means that the correlation is always nearly a perfectmatch. This principle of additional camera channels to completely removeambiguity or add information can be realised to advantage, using camerasto generate near orthogonal baselines and/or as a set of three to allowtwo orthogonal stereo systems to be generated. FIG. 13 shows anarrangement of a three camera system wherein the three cameras 160 andspot projector 22 are located in the same plane in a square arrangement.This arrangement allows cameras 160 a and 160 b to generate a verticalimage pair and cameras 160 b and 160 c to generate a horizontal imagepair to which stereo imaging techniques may be applied. This can allowanalysis of edges in the image which can be coupled with the rangeinformation obtained through processing the spot positions.

To improve resolution of acquired range points one embodiment of theinvention shown in FIG. 12 has an optical means for displacing theprojected array in the scene. A spot projector 22 such as describedabove is arranged with a camera 6. However in front of the spotprojector 22 is a refractive wedge 150. The effect of the refractivewedge is to deflect slightly the light from the spot projector. As shownthe light is deflected by a small angle φ from the path it would takewhere the wedge omitted. The wedge 150 is mounted for rotation and as itrotates changes the direction in which the light is deflected. FIG. 12 ashows a first position and FIG. 12 b shows the situation after the wedgehas been rotated through 180°. The wedge is arranged to be rotatedbetween four positions, each 90′ apart, and the camera takes an image ateach position. The effect is to dither the array of spots in the scene.The angle φ is small so that the spots move only a fraction of theobserved inter spot spacing. There in each of the four images acquiredthe spots are observed at different positions and in this way more rangepoints to the scene are taken which can be collated together to give oneaccurate range map.

It should generally be noted that as the kaleidoscope spot projector asdescribed above does not have an optical axis as generally understoodthere is no need to align this optical axis to the principal axis of thedetector. It is generally arranged so that the best spot pattern isobserved in the operating range which is usually when the spot projectoris inclined with respect to the detector to place the brightest regionof the spot pattern in the centre of the detector image at the likelyworking distance. Even when a spot projector is used that does have anoptical axis the best result is still generally obtained with the axesinclined and not necessarily parallel as suggested in U.S. Pat. No.4,867,570.

A ranging system as described could be used in any number ofapplications. As the spot projection system is easy and inexpensive tomanufacture and need not interfere with a visible image being acquiredvirtually any camera system could be integrated with a ranging systemaccording to the present invention. Ranging systems according to thepresent invention could be used to improve imaging target identificationsystems as the range to the scene would reveal addition informationabout object edges. This could be used in security applications forintruder alarms and the like. Alternatively range information couldimprove object identification, for instance facial recognition.

The apparatus could also be used in a wide range of surveying or mappingapplications. When used in such applications the range finding cameramay comprise a location sensor for determining the location of thecamera as each image of the scene is recorded. The location sensor couldcomprise a GPS receiver, a tip/tilt sensor and a magnetic field sensor.Alternatively a beacon such as a magnetic field source could be placedin a known position and a magnetic field gradiometer used to determinethe location of the camera relative to the beacon. Inertial sensors coulalso be used to record how the camera is moved. In this way the positionand orientation of the camera is known when the image is taken. Knowingthe exact location and orientation of the camera means that rangeinformation to objects in a scene can be translated into positionalinformation about the scene. For instance imagine several images aretaken of a room from different viewpoints. Each image (and here imagemeans the recorded layout of spots in the observed scene and notnecessarily a complete contrast image of the scene) can be used tocreate a model that part of the scene observed. When several images aretaken and the position of the camera each time known the data from thevarious images can be used to create one three dimensional model of theroom. As mentioned this could find application for surveying andmapping. Objects may also be imaged from various directions and the dataused to create a three dimensional model which is useful for computeraided design and simulation or modelling s well as creating virtualreality environments.

The system has obvious potential for use in proximity sensors, forinstance such as those employed in vehicles. Also in vehicles rangeinformation could be collected about the occupant position which couldbe used in safer deployment of emergency safety equipment such as airbags. The apparatus could be used in robotic vision systems as rangeinformation would help a robotic system navigate. It could also be usedto help pilot UVs (unmanned vehicles).

Range information could be used to acquire three dimensional informationuseful for modelling of objects. Biometric information could be acquiredto ensure correct sizing of clothing. A booth provided could be providedwith a plurality of cameras and spot projectors to image a whole person,possibly from more than one viewing direction. A person could then standmomentarily within such a booth and be imaged and ranged from amultiplicity of directions. This information could be captured andprocessed to give create a model of the person which could be used forvarious design or garment fitting applications. As the cameras would bein fixed relationship to each other there would be no need for anyadditional positional information to be acquired.

Another useful embodiment is in document scanning. Scanning ofdocuments, such as books, generally requires the page of the book to bepressed as flat as possible against a transparent surface through whichthe book or document is images. However it is not always practical toimage a document in such a manner. Were the document imaged as it justlay open however the curvature of the book would mean that a distortedimage would result. Were however the imager combined with a rangefinding apparatus as described the range to the surface of the bookcould reveal the curvature thereof. Image processing algorithms couldthen be used to correct the imaged page for the curvature thereof andpresent a ‘flat’ image.

Other applications and embodiments of the invention will be apparent tothe skilled person however without departing from the spirit of theinvention.

1. A ranging apparatus comprising an illumination means for illuminatinga scene with a projected two dimensional array of light spots, adetector for detecting the location of spots in the scene and aprocessor adapted to determine, from the detected location of a spot inthe scene, the range to that spot.
 2. A ranging apparatus as claimed inclaim 1 wherein the illumination means and detector are arranged suchthat each spot in the projected array appears to move in the detectedscene, from one range to another, along an axis and the axis of apparentmotion of each adjacent spot in the projected array is different.
 3. Aranging apparatus as claimed in claim 1 wherein the illumination meansis adapted to project an array of spots which is focussed at a firstdistance and unfocussed at a second distance, the first and seconddistances being within the operating range of the apparatus.
 4. Aranging apparatus as claimed in claim 3 wherein the illumination meansis adapted to project an array of spots which are non-circular in shapewhen focussed.
 5. A ranging apparatus as claimed in claim 1 wherein theprocessor is adapted to resolve any possible ambiguity in range to eachspot.
 6. A ranging apparatus as claimed in claim 1 wherein theillumination means has a large depth of field.
 7. A ranging apparatus asclaimed in claim 1 wherein the illumination means is adapted toperiodically alter the two dimensional array of projected spots.
 8. Aranging apparatus as claimed in claim 7 wherein the illumination meansis adapted to illuminate the scene cyclically with different arrays ofspots.
 9. A ranging apparatus as claimed in claim 7 wherein theprocessor is adapted to determine any areas of ambiguity in the detectedarray and deactivate one or more of the projected spots so as to resolvethe ambiguity.
 10. A ranging apparatus as claimed in claim 1 wherein theillumination means is adapted to so as to produce an array of spotswherein at least some projected spots have a different characteristic toadjacent spots.
 11. A ranging apparatus as claimed in claim 10 whereinthe characteristic is colour.
 12. A ranging apparatus as claimed inclaim 10 wherein the characteristic is shape.
 13. A ranging apparatus asclaimed in claim 1 wherein the spots comprise intersections betweencontinuous lines.
 14. A ranging apparatus as claimed in claim 13 whereinthe illumination means projects two sets of regularly spaced lines, thetwo sets of lines being substantially orthogonal.
 15. A rangingapparatus as claimed in claim 14 wherein the processor is adapted todetermine the range to the intersections between the continuous linesand then, using the determined range information determine the range toother points on the continuous lines.
 16. A ranging apparatus as claimedin claim 1 wherein the detector comprises a two dimensional CCD or CMOSarray.
 17. A ranging apparatus as claimed in claim 1 wherein theillumination means is adapted such that the two dimensional array ofspots are infrared spots.
 18. A ranging apparatus as claimed in claim 17wherein the detector is adapted to capture a visible image of the sceneas well as the location of the infrared spots in the scene.
 19. Aranging apparatus as claimed in claim 1 wherein the baseline between theillumination means and the detector is between 50 and 100 mm.
 20. Aranging apparatus as claimed in claim 1 wherein the detection system isadapted to image the scene from more than one direction.
 21. A rangingapparatus as claimed in claim 18 wherein the apparatus includes scanningoptics in the optical path to the detector adapted to periodicallyredirect the viewing direction of the detector.
 22. A ranging apparatusas claimed in claim 20 wherein the detector comprises two detectorarrays each detector array arranged so as to image the scene from adifferent direction.
 23. A ranging apparatus as claimed in claim 1wherein the apparatus comprises a plurality of detectors, each arrangedto image a scene from a different direction.
 24. A ranging apparatus asclaimed in claim 20 wherein the processor applies image processingalgorithms to the scenes from each viewpoint to determine rangeinformation therefrom.
 25. A ranging apparatus as claimed in claim 20wherein the detector means is adapted to have a different baseline tothe illumination means in each viewpoint.
 26. A ranging apparatus asclaimed in claim 20 wherein the processor is adapted to determine thepossible range to the scene from each viewpoint and compare the possibleranges to resolve any ambiguity.
 27. A ranging apparatus as claimed inclaim 20 wherein the baseline of at least two of the viewpoints liealong different axes.
 28. A ranging apparatus as claimed in claim 1wherein the apparatus further comprises a plurality of illuminationmeans arranged to illuminate the scene from different directions.
 29. Aranging apparatus as claimed in claim 28 wherein the apparatus isadapted to periodically change the illumination means used to illuminatethe scene.
 30. A ranging apparatus as claimed in claim 29 wherein theprocessor is adapted to determine the possible range to the scene whenilluminated with each illumination means and compare the possible rangesto resolve any ambiguity.
 31. A ranging apparatus as claimed in claim 28wherein each illumination means is arranged to have a different baselineto the or each detector or detector array.
 32. A ranging apparatus asclaimed in claim 28 wherein at least two of the illumination meansproject spots having different characteristics.
 33. A ranging apparatusas claimed in claim 1 wherein the illumination means comprises a lightsource arranged to illuminate part of the input face of a light guide,the light guide comprising a tube having substantially reflective sidesand being arranged together with projection optics so as to project anarray of distinct images of the light source towards the scene.
 34. Aranging apparatus as claimed in claim 33 wherein the light guidecomprises a tube having a square cross section.
 35. A ranging apparatusas claimed in claim 33 wherein the light guide comprises a tube havingreflective internal surfaces.
 36. A ranging apparatus as claimed inclaim 33 wherein the light guide comprises a tube of solid materialadapted such that a substantial amount of light incident at an interfacebetween the material of the tube and surrounding material undergoestotal internal reflection.
 37. A ranging apparatus as claimed in claim33 wherein the projection optics comprises a projection lens.
 38. Aranging apparatus as claimed in claim 33 wherein the light source isarranged to illuminate the input face of the light guide through a mask.39. A ranging apparatus as claimed in claim 27 wherein the light sourceilluminates the input face of the light guide with a non-circular shape.40. A ranging apparatus as claimed in claim 32 wherein the light sourceilluminates the input face of the light guide with a shape which is nonsymmetric about the axes of reflection of the light guide.
 41. A rangingapparatus as claimed in claim 33 wherein the illumination meanscomprises more than one light source, each light source arranged toilluminate part of the input face of the light guide.
 42. A rangingapparatus as claimed in claim 41 wherein the light sources are arrangedin a regular pattern.
 43. A ranging apparatus as claimed in any ofclaims 41 wherein the light sources are arranged to provide differingspot densities.
 44. A ranging apparatus as claimed in claim 41 whereinat least one light source emits light at a different wavelength toanother light source.
 45. A ranging apparatus as claimed in claim 41wherein at least one light source is shaped differently to another lightsource.
 46. A ranging apparatus as claimed in claim 41 wherein at leastone light source has a shape which is not symmetric about a reflectionaxis of the light guide.
 47. A ranging apparatus as claimed in claim 41wherein at least one light source is located within the light guide at adifferent depth to another light source.
 48. A ranging apparatus asclaimed in claim 1 further comprising a means for periodicallyredirecting the array of spots in the scene.
 49. A ranging apparatus asclaimed in claim 1 further comprising a location sensor.
 50. A proximitysensor incorporating a ranging apparatus as claimed in claim
 1. 51. Atarget identification apparatus incorporating a ranging apparatus asclaimed in claim
 1. 52. An intruder detection system incorporating aranging apparatus as claimed in claim
 1. 53. A biometric modellingapparatus incorporating a ranging apparatus as claimed in claim
 1. 54. Adocument scanner comprising an imager and a ranging apparatus as claimedin claim 1, wherein the imager is adapted to process the rangeinformation from the document to determine the extent of curvaturethereof and process the detected image to correct for any curvature. 55.An image recorder having a large depth of field comprising anillumination means for illuminating a scene with an array of spots andan imaging array for recording an image of the scene characterised inthe illumination means is adapted to illuminate the scene such that thelocation of spots in the recorded image can be used to give adetermination of range without any ambiguity.
 56. A method of obtainingrange information about a scene comprising the steps of illuminating thescene with an array of spots, taking an image of the spots in the scene,uniquely identifying each spot in the scene and determining, from thelocation of each spot in the scene the range to that spot.
 57. A methodof obtaining range information about a scene as claimed in claim 56wherein the step of illuminating the scene comprises the step ofilluminating the scene with spots which have a non-circular shape andwhich are focussed at one range and unfocussed at another range and thestep of uniquely identifying each spot in the scene involves determiningwhether the spot is focussed or not.
 58. A method of obtaining rangeinformation about a scene as claimed in claim 56 wherein the step ofilluminating the scene comprises the step of projecting an array ofspots such that at least some of the projected spots are of a differentshape and/or colour to other spots and the step of uniquely identifyingeach spot in the scene involves determining the colour and or shape of aspot.
 59. A method of obtaining range information about a scene asclaimed in claim 56 wherein the step of recording an image of the scenecomprises the step of recording an image of the scene from a pluralityof viewpoints with the same illumination.
 60. A method of obtainingrange information about a scene as claimed in claim 59 wherein the stepof uniquely identifying each spot in the scene comprises the step ofcomparing the position of a spot from more than one viewpoint so as touniquely identify that spot.
 61. A method of obtaining range informationabout a scene as claimed in claim 56 further comprising the step ofrecording information about the position from which the image wasrecorded for each recorded image.
 62. A method of identificationcomprising the step of obtaining range information about a sceneaccording to claim 56 and comparing said range information withreference shape information corresponding to an item to be identifiedand giving an indication of quality of match of the detected shape tothe reference item.
 63. A method as claimed in claim 62 wherein thematching step uses model coefficients or best fit methods.